package com.yeyks.commonReference.append.mattress.wechat.config;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 床垫微信属性对象
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Component
@ConditionalOnProperty(prefix = "wechat.mattress.pay", name = "gzhAppId", matchIfMissing = false)
@ConfigurationProperties(prefix = "wechat.mattress.pay")
public class MattressWxProperties {

    //公众号获取code对应的openId链接地址
    private static final String getGzhOpenIdUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code";
    //小程序获取code对应的openId链接地址
    private static final String getXcxOpenIdUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code";

    //公众号(AppId)
    private String gzhAppId;
    //公众号(secret)
    private String gzhSecret;
    //微信商户号
    private String mchId;
    //微信商户key
    private String mchKey;
    //证书，退款时需要
    private String keyPath;
    //微信支付回调
    private String newNotifyUrl;
    //微信授权回调地址
    private String redirectUrl;

}
